package com.taikang.hmp.hbusiness.diabetes.measure.talk.action.view;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.taikang.hmp.frame.common.TKException;
import com.taikang.hmp.frame.common.datastructre.Dto;
import com.taikang.hmp.frame.common.datastructre.support.BaseDto;
import com.taikang.hmp.frame.common.datastructre.support.ResponseDto;
import com.taikang.hmp.frame.common.web.action.BaseAction;
import com.taikang.hmp.hbusiness.diabetes.measure.talk.action.intface.TalkAction;
import com.taikang.hmp.hbusiness.diabetes.measure.talk.service.ITalkService;

/** 
 * 咨询管理
 * author:qrp
 * time:2015年12月18日 下午1:51:35
 */
public class TalkViewAction extends BaseAction{
	private static final long serialVersionUID = 1L;
	private static Logger logger = LoggerFactory.getLogger(TalkAction.class);
	
	private ITalkService talkService;
	
	public ITalkService getTalkService() {
		return talkService;
	}

	public void setTalkService(ITalkService talkService) {
		this.talkService = talkService;
	}

	public String executeAction() {
		if ("getHealtherInfo".equals(requestDto.getMethod())) {
			logger.info("--【获取健康管理师信息】: method getHealtherInfo --");
			return getHealtherInfo();
		} else {
			logger.info("executeAction 里没有配置" + requestDto.getMethod() + "方法!");
			throw new TKException("no support method:" + requestDto.getMethod());
		}
	}
	/**
	 * 获取健康管理师信息
	 * @return
	 */
	public String getHealtherInfo(){
		ResponseDto responseDto = new ResponseDto();
		//获取参数
	    Dto paramDto = requestDto.getRequestlist().get(0);
	    paramDto = super.appendRequestBase(paramDto, requestDto);
	    
	    Dto result = talkService.getHealtherInfo(paramDto);	
	    Dto resultDto = new BaseDto();
		resultDto.put("resultlist", result);
		responseDto.pushResultDto(resultDto);
		//
		super.setDataMap(responseDto);
		return SUCCESS;
	}

}
